package com.ctshk.rpc.payment.dto.req.wechat;

import com.alibaba.fastjson.annotation.JSONField;
import com.ctshk.rpc.payment.dto.WeChatPayConfig;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @BelongsProject: ctshk-cloud
 * @BelongsPackage: com.ctshk.rpc.payment.dto.req.wechat
 * @Author: hef
 * @CreateTime: 2021-05-08 14:15
 * @Description: 描述
 */
@Data
public class WeChatPayRefundReq extends WeChatPayCommonReq {
    /**
     * 订单号
     */
    @JSONField(name = "o_sn")
    private String oSn;
    /**
     * 退款金额
     */
    @JSONField(name = "refund_fee")
    private Long refundFee;
    /**
     * 退款单号
     */
    @JSONField(name = "out_refund_no")
    private String outRefundNo;


    public WeChatPayRefundReq(String method, WeChatPayConfig config,
                              String oSn, BigDecimal refundFee, String outRefundNo) {
        super(method, config);
        this.oSn = oSn;
        this.refundFee = refundFee.multiply(BigDecimal.valueOf(100)).longValue();
        this.outRefundNo = outRefundNo;
    }
}
